function submit() {
    var deptName = $("#deptName").find("option:selected").text();
    var name = $("#name").val();
    var phone = $("#phone").val();
    var openid = $("#open").val();
    var url = basePath + "/wechat/regist";
    $.ajax({
        url: url,
        type: 'post',
        data: {
            "name": name,
            "phone": phone,
            "deptName": deptName,
            "openid": openid
        },
        dataType: 'json',
        success: function (ajaxData) {
            if (ajaxData.code != 1) { //todo code=1 成功
                alert(ajaxData.msg);
            } else {
                window.location.href = "PhoneSuccess.html";
            }
        }, error: function (ajaxData) {
            alert(ajaxData.msg);
        }
    });
}
$(document).ready(function () {
    var borderW = document.getElementById("deptName").offsetWidth;
    var borderH = document.getElementById("deptName").offsetHeight;
    var headH = document.getElementById("head").offsetHeight;
    $("input").css({"width": borderW-5 + "px", "height": borderH + "px","padding":"0px","text-indent":"5px"});
    $("#inputBox").css("margin-top", -(headH / 5) + "px");
    $("#submit").click(function () {
        submit();
    })
})
